var express = require("express");
var router = express.Router();
// var adminModel = require("../../models/user/admin");

router.post("/", function (req, res, next) {
  let { account, password } = req.body;
  // adminModel.find({ account }, function (err, docs) {
  //   if (!err) {
  //     if (docs[0].password === password) {
  //       res.json({ data: null, msg: "登陆成功！", code: 200 });
  //     } else {
  //       res.json({ data: null, msg: "账号或密码错误", code: 401 });
  //     }
  //   }
  // });
  if (account === "admin" && password === "admin") {
    res.json({ msg: "登录成功！", code: 200 });
  } else {
    res.json({ msg: "账号或密码错误", code: 401 });
  }
});

module.exports = router;
